/*
 * Created on Feb 25, 2005
 */
package com.scalar.chiptrack.finance.openpo.actioncommands;

import com.scalar.chiptrack.ChipTrackExtendedAction;
import com.scalar.chiptrack.commons.Constants;

/**
 * @author Ravikanth
**/
public class PurchaseOrderReceiptCommandFactoryAction implements Constants
{
	private static PurchaseOrderReceiptCommandFactoryAction sPacfactory;

	public synchronized static PurchaseOrderReceiptCommandFactoryAction getInstance()
	{
		if ( sPacfactory == null )
		{
			sPacfactory = new PurchaseOrderReceiptCommandFactoryAction();
		}
		return sPacfactory;
	}

	private PurchaseOrderReceiptCommandFactoryAction()
	{
	}

	/**
	 * Returns the ActionCommand Class that implements businnes logic for the given action
	 *
	 * @param action
	 * @return
	 */
	public static ChipTrackExtendedAction getActionCommand( String action )
	{
		if( ACTION_NEW.equalsIgnoreCase( action ) )
		{
			return new PurchaseOrderReceiptNewCommand();
		}
		if ( ACTION_PURCHASE_ORDER_LINE_ITEM_LOT_DATA_ENTRY.equalsIgnoreCase ( action) )
		{
			return new ReceivingLineItemLotDataEntryCommand();
		}
		if ( ACTION_PURCHASE_ORDER_LOT_DATA_ENTRY_ADD_MORE.equalsIgnoreCase ( action) )
		{
			return new RecevingLineItemLotDataEntryAddCommand();
		}
		if ( ACTION_PURCHASE_ORDER_LINE_ITEM_LOT_DATA_ENTRY_CLOSE.equalsIgnoreCase ( action) )
		{
			return new RecevingLineItemLotDataEntryCloseCommand();
		}
		if( ACTION_CONFIRM.equalsIgnoreCase( action ) )
		{
			return new PurchaseOrderReceiptConfirmCommand();
		}
		if( ACTION_EDIT.equalsIgnoreCase( action ) )
		{
			return new PurchaseOrderReceiptEditCommand();
		}
		if( ACTION_SAVE.equalsIgnoreCase( action ) )
		{
			return new PurchaseOrderReceiptSaveCommand();
		}
		if( ACTION_UPDATE.equalsIgnoreCase( action ) )
		{
			return new PurchaseOrderReceiptUpdateCommand();
		}
        if( ACTION_PURCHASE_ORDER_PRINT_VIEW.equalsIgnoreCase( action ) )
        {
            return new PurchaseOrderReceiptPrinterFriendlyCommand();
        }
        if( ACTION_PURCHASE_ORDER_LOAD_PART_NUMBERS.equalsIgnoreCase( action ) )
        {
            return new PurchaseOrderReceiptLoadLotPartNumbersCommand();
        }

		return null;
	}
}
